<template>
	<view class="setting-box">
		<my-top :isline="true" title="外观设置">
		</my-top>
		<view class="systemSetting">
			<text>跟随系统深色外观</text>
			<switch checked="true" />
		</view>
		<view style="margin-top: 2rpx;" class="systemSetting">
			<text>字体大小</text>
			<text class="iconfont todaygengduo"></text>
		</view>

		<view class="theme">
			<view class="themeTitle">纯色主题</view>
			<view class="color-box">
				<view @click="getColorItem(index)" style="text-align: center;" v-for="(item,index) in colorBlockList" :key="index">
					<view class="color-item" :style="{'background-color':item.color}">
						<view v-if="colorActive == index" :style="{'background-color':item.color}" class="color-active">
							<!-- <text class="yep">√</text> -->
						</view>
					</view>
					<view style="margin-top: 16rpx;">{{item.name}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				colorActive: 0,
				colorBlockList: [{
						name: "官方蓝",
						color: "#9AB1FF"
					},
					{
						name: "官方粉",
						color: "#FFB8B8"
					},
					{
						name: "绿色",
						color: "#6BDFA4"
					},
					{
						name: "黄色",
						color: "#FED28B"
					},
				]
			}
		},
		methods: {
			getColorItem(index) {
				this.colorActive = index;
			}
		}
	}
</script>

<style scoped lang="scss">
	.yep {
		position: absolute;
		top: 20%;
		left: 20%;
		font-weight: bolder;
		font-size: 28rpx;
		color: white;
	}

	.color-active {
		width: 36rpx;
		height: 36rpx;
		border-radius: 50%;
		padding: 20rpx;
		position: absolute;
		right: -20rpx;
		bottom: -20rpx;
		border: 6rpx solid #FFFFFF;
	}

	.color-box {
		width: 100%;
		padding: 0 40rpx;
		display: flex;
		justify-content: space-between;

		.color-item {
			width: 116rpx;
			height: 116rpx;
			text-align: center;
			position: relative;
			border-radius: 10rpx;
		}
	}

	.themeTitle {
		color: #999999;
		font-size: 24rpx;
		width: 1000%;
		padding-left: 32rpx;
		height: 77rpx;
		line-height: 77rpx;
	}

	.theme {
		margin-top: 20rpx;
		background-color: #FFFFFF;
		height: 302rpx;
		border-bottom: 3rpx dashed #DDDDDD;
	}

	.setting-box {
		width: 100%;
		min-height: 100vh;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-color: #F8F8F8;
	}

	.systemSetting {
		width: 100%;
		padding: 0 32rpx;
		display: flex;
		align-items: center;
		height: 88rpx;
		background-color: #FFFFFF;
		justify-content: space-between;
		color: #666666;
		font-size: 28rpx;
	}
</style>
